package com.ai.module.chat.common.enu;

import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author: heJinQin
 * @create: 2024-03-08 00:21
 * @description:
 **/
 @Getter
 @AllArgsConstructor
public enum MidJourneyParam {
    //    图片的比例
    PICTURE_SCALE("pictureScale"," --ar "),
    //    质量  默认1 .25 .5   1  2
    QUALITY("quality"," --q "),
    //    图像参数权重。0到2之间，默认为0.25，数学越大越代表图对他的影响越大
    PICTURE_WEIGHT("pictureWeight"," --iw "),
    //  艺术感，值越高越有艺术感 0–1000 默认  100
    STYLIZE("stylize"," --stylize "),
    // 0-100
    CREF(" --cref "," --cw ")
    ;
    //  --relax  --niji --fast
    String name;

    String value;

    @Deprecated
    public static String getValue(String name){

        if (StringUtils.isBlank(name)){
            return StringPool.EMPTY;
        }

        MidJourneyParam[] midJourneyParams = MidJourneyParam.values();
        for (MidJourneyParam midJourney : midJourneyParams) {
            String midJourneyName = midJourney.getName();
            if (Objects.equals(name,midJourneyName)){
                return midJourney.getValue();
            }
        }
        return StringPool.EMPTY;
    }


}
